// ActionScript file
import mx.controls.Alert;


public var executer:Executer = null;

public function init():void
{
	executer = Executer.getInstance();
	executer.execute(
		function():void{
			Alert.show("entre 1");
			//var timer:Timer = new Timer(1000,1);
			executer["timer"] = new Timer(1000,1);
			executer["timer"].addEventListener(TimerEvent.TIMER_COMPLETE,executer.onEvent);
			executer["timer"].start();
		},
		function():void{
			Alert.show("entre 2");
			executer["timer"].reset();
			executer["timer"].start();
		},
		function():void{
			executer.execute(
				function():void{
									Alert.show("entre 3");
									executer["timer"].reset();
									executer["timer"].start();
				},
				function():void{
									Alert.show("entre 4");
									executer["timer"].reset();
									executer["timer"].start();
				},
				function():void{
					executer.execute(
										function():void
										{
											//executer.returns("goodbye");
											Alert.show("entre 5");
											//executer.breaks();
											//executer.continues("hello");
											executer["timer"].reset();
											executer["timer"].start();
										},
										function():void
										{
											//Alert.show(executer.lastEvent);
											Alert.show("entre 6");
											executer["timer"].reset();
											executer["timer"].start();
										}
									);
				},
				function():void{
									//Alert.show(executer.lastEvent);
									Alert.show("Entre 7");
									executer["timer"].reset();
									executer["timer"].start();
				}
			);
		},
		function():void{
			Alert.show("entre 8");
		}
	);
}